<template>
        <div>
          <el-form :model="handleForm"   label-width="140px" class="demo-applyform" size="mini">
            <el-row>
              <el-col :span="8">
                <el-form-item label="客户类型" prop='clientType' >
                  <el-select v-model="handleForm.clientType" placeholder="请选择" style="width: 100%;">
                    <el-option label="正常解保后续作" value="1"></el-option>
                    <el-option label="新增业务" value="2"></el-option>
                    <el-option label="其他审批类" value="3"></el-option>
                    <el-option label="风险化解" value="4"></el-option>
                    <el-option label="体系反担保" value="5"></el-option>
                    <el-option label="其他备案类" value="6"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="申请金额">
                  <el-input v-model="handleForm.curreny"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="申请期限(月)" >
                  <el-input v-model="handleForm.guaterm" ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
                <el-col :span="8">
                    <el-form-item label="业务类型" prop='businessType' >
                            <el-input v-model="handleForm.businessType"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="担保受益方" >
                            <el-select v-model="handleForm.bankid" placeholder="请选择" style="width: 100%;">
                            <el-option label="农业银行" value="1"></el-option>
                            <el-option label="建设银行" value="2"></el-option>
                            <el-option label="工商银行" value="3"></el-option>
                            </el-select>
                        </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="放款银行" >
                            <el-select v-model="handleForm.loanBank" placeholder="请选择" style="width: 100%;">
                            <el-option label="农业银行" value="1"></el-option>
                            <el-option label="建设银行" value="2"></el-option>
                            <el-option label="工商银行" value="3"></el-option>
                            </el-select>
                        </el-form-item>
                </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="业务品种">
                  <el-input v-model="handleForm.serviceType" disabled></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                    <el-form-item label="受理日期" >
                        <el-date-picker
                            disabled
                            v-model="handleForm.handleTime"
                            type="date"
                            style="width: 100%;"
                            placeholder="选择日期">
                        </el-date-picker>
                    </el-form-item>
              </el-col>
              <el-col :span="8">
                    <el-form-item label="受理人员">
                        <el-input v-model="handleForm.handleUserName" disabled></el-input>
                    </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                    <el-form-item label="项目编号">
                        <el-input v-model="handleForm.projCode" disabled></el-input>
                    </el-form-item>
              </el-col>
              <el-col :span="8">
                    <el-form-item label="项目经理A角">
                      <el-select v-model="handleForm.managera"  style="width: 100%;" placeholder="请选择">
                        <el-option
                          v-for="item in users"
                          :key="item.id"
                          :label="item.realName"
                          :value="item.id">
                        </el-option>
                      </el-select> 
                    </el-form-item>
              </el-col>
              <el-col :span="8">
                    <el-form-item label="项目经理B角">
                        <el-select v-model="handleForm.managerb" style="width: 100%;" placeholder="请选择">
                        <el-option
                          v-for="item in users"
                          :key="item.id"
                          :label="item.realName"
                          :value="item.id">
                        </el-option>
                      </el-select> 
                    </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-form-item label="融资用途">
                  <el-input type="textarea" v-model="handleForm.loanPurpose"></el-input>
              </el-form-item>
            </el-row>
            <el-row>
              <el-form-item label="还款来源">
                  <el-input type="textarea" v-model="handleForm.returnsumsource"></el-input>
              </el-form-item>
            </el-row>
            <el-row>
              <el-form-item label="备注">
                  <el-input type="textarea" v-model="handleForm.remark"></el-input>
              </el-form-item>
            </el-row>
          </el-form>
        </div>
      </template>
      
      <script>
      export default {
        data() {
          return {
            handleForm: {
                clientType:'',
                curreny:'',
                guaterm:'',
                businessType:'',
                bankid:'',
                loanBank:'',
                serviceType:'',
                handleTime:new Date(),
                handleUserName:'',
                handleUserId:'',
                projCode:'',
                managera:'',
                managerb:'',
                loanPurpose:'',
                returnsumsource:'',
                remark:'',
            },
            status: false,
            users:[]
          };
        },
        mounted() {
          this.getusers();
        },
        methods: {
          init(id){
            this.$api.formPost( '/api/biz/projectApply/doGetProjApplyList',{
              id:id
            }).then(res => {
                  if(res.retHead.code=="0000000"){
                      let user=JSON.parse(sessionStorage.getItem("user"));
                      this.handleForm.clientType = res.retBody.list[0].bizNature;
                      this.handleForm.curreny=res.retBody.list[0].applyMoney;
                      this.handleForm.guaterm=res.retBody.list[0].applyDeadlines;
                      this.handleForm.loanBank=res.retBody.list[0].loanBank;
                      this.handleForm.serviceType=res.retBody.list[0].serviceType;
                      this.handleForm.handleUserId=user.id;
                      this.handleForm.handleUserName=user.realName;
                      this.handleForm.loanPurpose=res.retBody.list[0].loanPurpose;
                      this.handleForm.returnsumsource=res.retBody.list[0].returnsumsource;
                      this.handleForm.projName=res.retBody.list[0].entName;
                      this.handleForm.managera=user.id;
                  }else{
                      this.$message({
                          type: 'error',
                          message: res.retHead.message
                      });
                  }
              });
          },
          getdata() {
            return this.handleForm;
          },
          //获取用户信息
          getusers() {
              let params = {};
              this.$api
                .formPost(  "/api/auth/sysuser/doGetList", params)
                .then(res => {
                  if (res.retHead.code == "0000000") {
                    this.users = res.retBody.list;
                  }
                });
            },
        }
      };
      </script>
      <style lang='scss' scoped>
      </style>